/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aiaudio.database.tables;

import aiaudio.database.Family;
import java.util.NavigableMap;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.util.Bytes;

/**
 *
 * @author nastya
 */
public class ReduceDictionaryTable extends TableStructure{

    private static final Family VALUES = new Family("v");

    public static NavigableMap<byte[], byte[]> getCentroids(Result dictResult) {
        return dictResult.getFamilyMap(VALUES.getNameAsBytes());
    }

    public static void addCentroid(Put put, int dictionaryNumber, byte[] artistId) {
        put.add(VALUES.getNameAsBytes(), Bytes.toBytes(dictionaryNumber), artistId);
    }
    
    @Override
    public Family[] getAllFamilies() {
        return new Family[]{VALUES};
    }
    
}
